home *** CD-ROM | disk | FTP | other *** search
- // MatchLoop.h
-
- #ifndef MatchLoop_h
- #define MatchLoop_h
-
- #ifndef ConstData_h
- #include "ConstData.h"
- #endif
-
- class PatternMatcher;
-
- class MatchLoop
- {
- private:
- const PatternMatcher *pattern;
- ConstData source;
- const uint8 *matchEnd;
- uint32 matchedPrefix;
-
- bool Matching() const;
- bool PartiallyMatching() const;
- void Advance();
-
- public:
- MatchLoop( const PatternMatcher& );
- MatchLoop( const PatternMatcher&, ConstData firstSource );
-
- void Start( ConstData source );
- void Continue( ConstData source );
-
- bool Finished() const { return matchEnd > source.End(); }
- bool Unfinished() const { return matchEnd <= source.End(); }
-
- void operator++();
- void operator++(int) { operator++(); }
-
- const uint8 *EndOfMatch() const { return matchEnd; }
- };
-
- #endif
-